      import {
        Dialog,
        Toast
      } from "vant";

      // 移动端物理返回键事件监听
      export function exitSystem() {
        Dialog.confirm({
            title: "提示",
            message: "退出系统？",
          })
          .then(() => {
            // on confirm
            // 销毁存放用户信息的session
            this.$session.destroy();
            Toast("退出成功！");
            this.$router.push({
              name: "loginPage"
            });
          })
          .catch(() => {
            // on cancel
            // this.active = this.$session.get("tabbar");
            // // 路由跳转
            // this.tansformRouter();
          });
      }
      // 处理base64编码，将处理后的图片格式全部改为png；
      export function delPic(obj) {
        var index = obj.indexOf("base64,");
        obj = obj.substring(index + 7, obj.length);
        let indexObj = "data:image/png;base64,";
        return indexObj + obj
      }
      //  数组根据id去重
      export function clearArr(arr, key) {
        // 去重
        var obj = {};
        let returnArr = arr.reduce(function (item = [], next) {
          obj[next.id] ? "" : (obj[next.id] = true && item.push(next));
          return item;
        }, []);

        return returnArr;
      }
      // 金额单位转换
      export function unitConvert(num) {
        var moneyUnits = ["元", "万元", "亿元", "万亿"];
        var dividend = 10000;
        var curentNum = num;
        //转换数字
        var curentUnit = moneyUnits[0];
        //转换单位
        for (var i = 0; i < 4; i++) {
          curentUnit = moneyUnits[i];
          if (strNumSize(curentNum) < 5) {
            break;
          }
          curentNum = curentNum / dividend;
        }
        var m = {
          num: 0,
          unit: ""
        };
        m.num = curentNum.toFixed(2);
        m.unit = curentUnit;
        return m;
      }
      const strNumSize = (tempNum) => {
        var stringNum = tempNum.toString();
        var index = stringNum.indexOf(".");
        var newNum = stringNum;
        if (index != -1) {
          newNum = stringNum.substring(0, index);
        }
        return newNum.length;
      }
